home *** CD-ROM | disk | FTP | other *** search
- property pSpr, pOrigLoc, pGlassType, pOrigMember, pGlassMask, pGlassCheat, pGlassIce, pContents, pContentString, pCapacity, pOverItem, pMyBarSlot, pOldIceAmount, pOldContents, pOldGlassType, pOldMember, penisBeer
- global debug, gWellSprite, gBarTopManager
-
- on beginSprite me
- global gLastVessel
- pSpr = sprite(me.spriteNum)
- if not debug then
- pSpr.visible = 0
- end if
- pGlassIce = sprite(me.spriteNum - 1)
- pGlassMask = sprite(me.spriteNum + 1)
- pGlassCheat = sprite(me.spriteNum + 2)
- pOverItem = 0
- penisBeer = member("BEE_twist")
- mEmptyGlass(me)
- pMyBarSlot = glassSpriteToBarSlot(me.spriteNum)
- end
-
- on mEmptyGlass me
- global gLastVessel
- if gLastVessel = pMyBarSlot then
- setPourClockText(" Drink Contents Shown Here")
- gLastVessel = 0
- end if
- pContents = [:]
- pContentString = EMPTY
- pSpr.member = pOrigMember
- sendSprite(pGlassIce, #mEmptyGlass)
- sendSprite(pGlassMask, #mEmptyGlass)
- sendSprite(pGlassCheat, #mEmptyGlass)
- replaceWellItem()
- end
-
- on mUpdateContents me, glassType, newContents, newGarnish, oldIceAmount
- if not voidp(newContents) then
- pContents = newContents
- end if
- if not voidp(newGarnish) then
- deleteProp(pContents, #olive)
- deleteProp(pContents, #lemonWedge)
- deleteProp(pContents, #orangeWedge)
- deleteProp(pContents, #limeWedge)
- deleteProp(pContents, #cherry)
- deleteProp(pContents, #lemontwist)
- deleteProp(pContents, #limetwist)
- if newGarnish <> #noGarnish then
- pContents[newGarnish] = 1
- end if
- end if
- pContentString = VOID
- mupdateDisplay(me, glassType)
- if glassType <> #beer then
- sendSprite(pGlassMask, #mUpdateLiquidLevel)
- sendSprite(pGlassIce, #mUpdateIceLevel, oldIceAmount)
- showGlassAccessories(me)
- end if
- end
-
- on mupdateDisplay me, glassType
- global gLastVessel
- gLastVessel = pMyBarSlot
- pContentString = buildVesselContentList(pSpr, pGlassType, " The Glass is Empty")
- showDrinkContents(glassType, pContentString, VOID)
- end
-
- on mPlaceDrink me, glassMember, newLoc, glassType, keepOldMaskAndIce, priorContents
- global gGlassware
- pSpr.member = glassMember
- pSpr.loc = newLoc
- pGlassType = glassType
- if pGlassType = #beer then
- mEmptyGlass(me)
- hideGlassAccessories(me)
- pContents = [#beer: 1]
- pCapacity = 0
- pSpr.visible = 1
- pOrigMember = glassMember
- pSpr.member = pOrigMember
- else
- if not keepOldMaskAndIce then
- if not voidp(priorContents) then
- pContents = priorContents
- else
- pOrigMember = glassMember
- mEmptyGlass(me)
- end if
- pSpr.visible = 1
- pCapacity = getCapacity(pGlassType)
- sendSprite(pGlassIce, #mPlaceDrink, glassMember, newLoc)
- sendSprite(pGlassMask, #mPlaceDrink, getMaskMember(me), newLoc)
- sendSprite(pGlassCheat, #mPlaceDrink, glassMember, newLoc)
- end if
- end if
- end
-
- on getMaskMember me
- return member(glassPrefix(pGlassType) && "mask" & pMyBarSlot)
- end
-
- on mRemoveDrink me
- pSpr.locH = -1000
- mEmptyGlass(me)
- sendSprite(pGlassIce, #mRemoveDrink)
- sendSprite(pGlassMask, #mRemoveDrink)
- sendSprite(pGlassCheat, #mRemoveDrink)
- end
-
- on mReduceLiquid me, drinkAll
- maxCount = count(pContents)
- repeat with X = maxCount down to 1
- thisIng = getPropAt(pContents, X)
- cat = getCategory(thisIng)
- if getOne([2, 4, 5, 6, 7, 8, 16], cat) then
- if drinkAll then
- deleteAt(pContents, X)
- next repeat
- end if
- pContents[X] = pContents[X] * 0.66000000000000003
- end if
- end repeat
- end
-
- on mHideDrink me
- pSpr.visible = 0
- hideGlassAccessories(me)
- end
-
- on hideGlassAccessories me
- sendSprite(pGlassIce, #mHideDrink)
- sendSprite(pGlassMask, #mHideDrink)
- sendSprite(pGlassCheat, #mHideDrink)
- end
-
- on showGlassAccessories me
- sendSprite(pGlassIce, #mShowDrink)
- sendSprite(pGlassMask, #mShowDrink)
- sendSprite(pGlassCheat, #mShowDrink)
- end
-
- on mShowDrink me
- pSpr.visible = 1
- showGlassAccessories(me)
- end
-
- on endSprite me
- pSpr.visible = 1
- end
-
- on mOverItem me, bottleSprite, spoutLoc, ingredient
- if (pGlassType = #beer) and not isGarnish(ingredient) then
- return 0
- else
- if pGlassType = #cocktail then
- return pourIntersection(pGlassMask, bottleSprite, spoutLoc)
- else
- return pourIntersection(pSpr, bottleSprite, spoutLoc)
- end if
- end if
- end
-
- on mouseLeave me
- if draggingIngredient() then
- hideToolTip()
- hideDrinkContents()
- end if
- pOverItem = 0
- end
-
- on mouseEnter me
- global gSpoonSprite, gToolTip
- if pSpr.visible then
- pOverItem = 1
- if pSpr.member = penisBeer then
- sendSprite(gToolTip, #mShowToolTip, pSpr, "Custom Molded Dildo", pSpr.loc)
- else
- showToolTip(pSpr, pGlassType)
- end if
- if draggingBarTopGlass() then
- exit
- end if
- if pSpr.member = penisBeer then
- refreshPourMeter("Dildo", VOID)
- else
- showToolTip(pSpr, pGlassType)
- end if
- if the mouseDown and (the clickOn <> gSpoonSprite.spriteNum) then
- mouseDown(me)
- end if
- end if
- end
-
- on mGetReceiveSound me
- if mHasIce(me) then
- soundName = "water_into_mglass_wice"
- else
- soundName = "water_into_mglass"
- end if
- return soundName
- end
-
- on isHoldingJuiceAndMixers
- return calcWimpyContents(pContents)
- end
-
- on mIsHoldingVolume me
- return calcContents(pContents)
- end
-
- on mIsHoldingLiquor me
- return calcLiquorContents(pContents)
- end
-
- on mIsHoldingLiquid me
- return calcLiquidContents(pContents)
- end
-
- on mIsHoldingPourable me
- return calcPourableContents(pContents)
- end
-
- on mIsEmpty me
- return calcEmpty(pContents)
- end
-
- on mHasIce me
- if voidp(pContents[#ice]) then
- return 0
- else
- return integer(pContents[#ice])
- end if
- end
-
- on mouseDown me
- global gRecipeWindow
- makePatronActive(pMyBarSlot)
- if isVisible(gRecipeWindow) then
- tell gRecipeWindow
- updateStage()
- end tell
- end if
- if the doubleClick then
- exit
- end if
- if draggingBottleThang() then
- if pGlassType = #beer then
- alertBeep()
- else
- pourIt(mGetReceiveSound(me))
- end if
- else
- if draggingBottleOrSpoon() then
- else
- if sprite(barSlotToSprite(pMyBarSlot)).pDrinksBeenServed then
- managerVO("I04")
- else
- if not draggingWellThang() and not draggingSpoon() then
- if keyPressed(SPACE) then
- exit
- end if
- pOrigLoc = pSpr.loc
- mStoreOldContents(me)
- sendSprite(gWellSprite, #mDragWellItem, pSpr, pSpr.member, VOID, pGlassType)
- mHideDrink(me)
- end if
- end if
- end if
- end if
- end
-
- on mStoreOldContents me
- pOldContents = duplicate(pContents)
- pOldIceAmount = pSpr.pGlassIce.pIceAmount
- pOldGlassType = pGlassType
- pOldMember = pSpr.member
- end
-
- on mDropIt me
- global gGlassDropWarning
- if modifierDown() or (pGlassType = #beer) or not mIsHoldingLiquid(me) then
- removeBarTopGlass(gBarTopManager, pMyBarSlot)
- else
- if mReplaceDrink(me) then
- if not gGlassDropWarning then
- remindAboutEmptyButton()
- gGlassDropWarning = 1
- end if
- end if
- end if
- end
-
- on mDoneDragging me
- newBarSlot = placeGlassOnBar(gWellSprite)
- if newBarSlot[#closest] = 0 then
- if (pGlassType = #beer) or modifierDown() or not mIsHoldingLiquid(me) then
- removeBarTopGlass(gBarTopManager, pMyBarSlot)
- else
- if mReplaceDrink(me) then
- remindAboutEmptyButton()
- end if
- end if
- else
- if newBarSlot[#closest] = pMyBarSlot then
- status = newBarSlot[#status]
- carded = newBarSlot[#carded]
- if newBarSlot[#empty] = 1 then
- managerVO("T05")
- else
- if status = #ordered then
- remindToHitServe()
- else
- if status = #carded then
- remindToTakeOrder()
- else
- if not carded then
- remindAboutID()
- end if
- end if
- end if
- end if
- mReplaceDrink(me)
- else
- if getBarTopGlass(gBarTopManager, newBarSlot[#closest]) <> #none then
- alertBeep()
- mReplaceDrink(me)
- else
- if sprite(barSlotToSprite(pMyBarSlot)).pDrinksBeenServed then
- if mReplaceDrink(me) then
- chillYouveServedDrink()
- end if
- else
- oldSlot = pMyBarSlot
- newSlot = newBarSlot[#closest]
- setBarTopGlass(gBarTopManager, newSlot, pOldMember, pOldGlassType, 0, pOldContents, VOID, pOldIceAmount)
- removeBarTopGlass(gBarTopManager, oldSlot)
- end if
- end if
- end if
- end if
- soundFX("mGlass_on_bartop", 0, 0)
- end
-
- on mReplaceDrink me
- global gBarTopManager
- if barSpotIsFree(gBarTopManager, pMyBarSlot) then
- removeBarTopGlass(gBarTopManager, pMyBarSlot)
- return 0
- else
- pSpr.loc = pOrigLoc
- mShowDrink(me)
- return 1
- end if
- end
-
- on mStirred me
- if countStirrableIngredients(pContents) > 1 then
- pContents[#stir] = 1
- end if
- end
-
- on mFill me, ingredient, liquidColor
- returnVal = fillVessel(me, ingredient, liquidColor)
- return returnVal
- end
-